package com.itheima.TestBreeder;

public class Breeder {

    public Breeder() {
    }

    //定义方法，传入动物类
    public void breed(Animal animal) {
        animal.eat();
        animal.drink();

        if (animal instanceof Swimming) {
            ((Swimming) animal).swimming();
        }
    }

}
